<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	import="com.taobao.open.javabean.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>My JSP 'index.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<link rel="shortcut icon" href="favicon.ico" />
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript">
			function deleterow(obj)
			{	
				var tr = obj.parentNode.parentNode;
				var tbody = tr.parentNode;
				tbody.removeChild(tr);
			}
			function sub()
			{
				alert("少安毋躁，正在开发!");
			}
			function setprice(obj,priceid)
			{
				document.getElementById(priceid).innerHTML = 12 * obj.value;
			}
		</script>
	</head>
	<body style="text-align: center; margin: 0" bgcolor=#eaf4fe>
		<form id="myform" method="post" action="show">
		</form>
		<%
			String username = (String) request.getAttribute("name");
		%>
		<div align="center"
			style="background-color: #465461; font-size: 20; width: 70%">
			<img alt="" src="images/test.jpg">
			欢迎您<%=username%>
		</div>
		<div style="height: 2"></div>
		<!--  -->
		<div align="center"
			style="height: 80%; width: 70%; background: #f3f3f3; padding: 0px; margin: 0px auto;">
			<div align="center"
				style="background: red; padding: 0px; margin: 0px auto;">
				<div id="home" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: f9f8f8; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					首页
				</div>
				<div id="stepone" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: #619dd7; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					创建新活动
				</div>
				<div id="steptwo" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: #619dd7; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					折扣专区
				</div>
				<div id="stepthree" align="right"
					style="border: 1px solid #ccc; background: #619dd7; border-top: none;; width: 40%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					<a href="http://www.baidu.com">帮助</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
			</div>
			<div style="height: 2"></div>
			<div>
				<img src="images/title3.jpg">
			</div>
			<div style="height: 2"></div>

			<table border="1" width="100%">
				<tr>
					<th>
						宝贝描述
					</th>
					<th>
						一口价
					</th>
					<th>
						淘宝VIP V3折扣
					</th>
					<th>
						限时折扣
					</th>
					<th>
						折后价
					</th>
					<th>
						每人限购数
					</th>
					<th>
						操作
					</th>
				</tr>
				<%
					String taobaoR = (String) request.getAttribute("taobaoResponse");
					Trade[] trades = (Trade[]) request.getAttribute("trades");
					String TotalResults = (String) request.getAttribute("TotalResults");
					if (taobaoR != null)
					{
						for (int i = 0; i < Integer.parseInt(TotalResults); i++)
						{
				%>
				<tr>
					<td>
						<img alt="" src='<%=trades[i].getPic_url()%>' width="50"
							height="50">
						<label><%=trades[i].getTitle()%></label>
					</td>
					<td align="center">
						<label style="color: red"><%=trades[i].getPrice()%></label>
					</td>
					<td align="center">
						-
					</td>
					<td align="center">
						<input type="text" style="width: 30" onkeyup="setprice(this,<%=trades[i].getNum_iid()%>)">折
					</td>
					<td align="center">
						<label id="<%=trades[i].getNum_iid()%>"></label>
					</td>
					<td align="center">
						<select>
							<%
								for (int k = 1; k < 51; k++)
										{
							%>
							<option value=<%=k%>>
								<%=k%>
							</option>

							<%
								}
							%>
						</select>
					</td>
					<td align="center">
						<img alt="" src="images/bg_btn3.gif" onclick="deleterow(this)">
					</td>
				</tr>
				<%
					}
					} else
					{
					}
				%>
			</table>
		</div>
		<div style="height: 100">
				<input type="button" value="点此完成" onclick="sub()">
			</div>
		<!--  -->
		<div align="center" id="bottom"
			style="background-color: #eaf4fe; width: 70%; line-height: 20px;">
			<font color="#808080"> Copyright (C) 2012-2013 www.qidian.com
				All Rights Reserved 版权所有</font>
		</div>
	</body>
</html>